package io.renren.sdapi.dto.httprequestparam.image2image;

import cn.hutool.core.util.StrUtil;
import lombok.Getter;

@Getter
public enum RequestTypeEnum {
    TYPE_A("line sketch", TypeARequest.class),
    TYPE_B("albuginea", TypeBRequest.class),
    TYPE_C("detailing", TypeCRequest.class),
    TYPE_D("inspiration", TypeDRequest.class),
    TYPE_E("redrawing", TypeERequest.class);

    private String type;

    private Class aClass;

    RequestTypeEnum(String type, Class aClass) {
        this.type = type;
        this.aClass = aClass;
    }

    public static Class<? extends BaseParam> getClassByType(String type){
        if(StrUtil.isBlank(type)){
            return null;
        }
        for(RequestTypeEnum item : RequestTypeEnum.values()){
            if(type.equals(item.getType())){
                return item.getAClass();
            }
        }
        return null;
    }
}
